package lab02.test31;

import java.util.ArrayList;
import java.util.List;

public class Test31 {
    public static void main(String[] args) {
        List<String> names = new ArrayList<String>();
        names.add("张三");
        names.add("李四");
        names.add("王五");
        names.add("马六");
        names.add("赵七");
        for (String n : names) {
            System.out.println(n);
            System.out.println(names.indexOf(n));
        }
        System.out.println("集合的大小："+names.size());
        names.remove(2);
        System.out.println("集合第三个元素："+names.get(2));
        System.out.println("集合大小："+names.size());
    }
}
